/*
 * CustomerOperations.java
 *
 * Created on Jan 15, 2011, 2:52:55 PM
 */

package edu.rit.varapp.graphical;

/**
 * Allows a client to select what operations they would like the application to perform.
 * @author Eric Kisner
 */
public class CustomerOperations extends javax.swing.JFrame {

    private int entityId;

    /** Creates new form CustomerOperations */
    public CustomerOperations( int entityId ) {
        initComponents();
        this.entityId = entityId;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        logoutButton = new javax.swing.JButton();
        purchasereviewButton = new javax.swing.JButton();
        infoeditButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel1.setText("Client Options");

        logoutButton.setText("Logout");
        logoutButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutButtonActionPerformed(evt);
            }
        });

        purchasereviewButton.setText("Review Your Purchases");
        purchasereviewButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                purchasereviewButtonActionPerformed(evt);
            }
        });

        infoeditButton.setText("Edit Your Information");
        infoeditButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                infoeditButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(59, 59, 59)
                        .addComponent(logoutButton))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(39, 39, 39)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(purchasereviewButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
                            .addComponent(infoeditButton, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(infoeditButton)
                .addGap(18, 18, 18)
                .addComponent(purchasereviewButton)
                .addGap(48, 48, 48)
                .addComponent(logoutButton)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void logoutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutButtonActionPerformed
        new Login().setVisible( true );
        this.dispose();
    }//GEN-LAST:event_logoutButtonActionPerformed

    private void infoeditButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_infoeditButtonActionPerformed
        new CustomerEditInfo( entityId ).setVisible( true );
        this.dispose();
    }//GEN-LAST:event_infoeditButtonActionPerformed

    private void purchasereviewButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_purchasereviewButtonActionPerformed
        new CustomerDisplayPurchaseInfo().setVisible( true );
        this.dispose();
    }//GEN-LAST:event_purchasereviewButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton infoeditButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JButton logoutButton;
    private javax.swing.JButton purchasereviewButton;
    // End of variables declaration//GEN-END:variables

}
